package com.gitee.muii.echarts.options.series.line;

import java.util.ArrayList;
import java.util.List;

import com.gitee.muii.echarts.Function;
import com.gitee.muii.echarts.options.series.Series;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class SeriesLine extends Series {
    
    private static final long serialVersionUID = 305293261960307396L;
    
    private static List<String> coordinateSystems = new ArrayList<>();
    private static List<String> symbols = new ArrayList<>();
    private static List<String> cursors = new ArrayList<>();
    private static List<String> steps = new ArrayList<>();
    
    static {
        coordinateSystems.add("cartesian2d");
        coordinateSystems.add("polar");
        
        symbols.add("circle");
        symbols.add("rect");
        symbols.add("roundRect");
        symbols.add("triangle");
        symbols.add("diamond");
        symbols.add("pin");
        symbols.add("arrow");
        symbols.add("none");
        
        cursors.add("pointer");
        //todo
        
        steps.add("start'");
        steps.add("middle");
        steps.add("end");
    }
    
    private String coordinateSystem;
    private Double xAxisIndex;
    private Double yAxisIndex;
    private Double polarIndex;
    private String symbol;
    /**
     * 数组,function,double
     */
    private Object symbolSize;
    private Double symbolRotate;
    private Boolean symbolKeepAspect;
    private Object[] symbolOffset;
    private Boolean showSymbol;
    private Boolean showAllSymbol;
    private Boolean hoverAnimation;
    private Boolean legendHoverLink;
    private String stack;
    private String cursor;
    private Boolean connectNulls;
    private Boolean clipOverflow;
    private Object step;
    //todo
    
    @Override
    public String getType() {
        return "line";
    }
    
    public void setCoordinateSystem(String coordinateSystem) {
        this.coordinateSystem = propertyOrDefault(coordinateSystems, coordinateSystem);
    }
    
    public void setSymbol(String symbol) {
        this.symbol = propertyOrDefault(symbols, symbol);
    }
    
    public void setSymbolSize(Object[] symbolSize) {
        this.symbolSize = symbolSize;
    }
    
    public void setSymbolSize(Function symbolSize) {
        this.symbolSize = symbolSize;
    }
    
    public void setSymbolSize(Double symbolSize) {
        this.symbolSize = symbolSize;
    }
    
    public void setCursor(String cursor) {
        this.cursor = propertyOrDefault(new ArrayList<>(), cursor, "pointer");
    }
    
    public void setStep(boolean step) {
        this.step = step;
    }
    
    public void setStep(String step) {
        this.step = propertyOrDefault(steps, step);
    }
    
}
